#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <sys/param.h>

#include <time.h>

int main(int argc, char **argv)
{
    time_t now;
    system("echo \"TestDaemonProcess!\\n\" >> logspp");
    while (1)
    {
        sleep(1);
        FILE *fd = fopen("./logspp", "a+");
        time(&now);
        fprintf(fd, "%s %d\n", ctime(&now), argv[1][0] - '0');
        fclose(fd);
    }
    return 0;
}